﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:prim="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Input.Toolkit" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:dvp="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit" mc:Ignorable="d">

    <!-- Global Settings. -->
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Brushes.xaml" />
        <ResourceDictionary Source="Fonts.xaml" />
        <ResourceDictionary Source="CoreStyles.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!-- 
    ***************************************************************************
    Expander
    ***************************************************************************
    -->

    <Style TargetType="toolkit:Expander">
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Foreground" Value="{StaticResource HeaderForegroundBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="TextOptions.TextHintingMode" Value="Animated" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:Expander">
                    <Grid Background="Transparent">
                        <Grid.Resources>
                            <ControlTemplate x:Key="ExpanderDownHeaderTemplate" TargetType="ToggleButton">
                                <Grid Background="Transparent">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CheckStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition GeneratedDuration="00:00:00" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Checked">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" To="8" Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="arrow" d:IsOptimized="True" />
                                                    <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="arrow" d:IsOptimized="True" />
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Data" Storyboard.TargetName="arrow">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="M0,0 L1,0 L0.5,1 z" />
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Margin" Storyboard.TargetName="arrow">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0,2,0,0" />
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Unchecked" />
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition GeneratedDuration="0" />
                                                <VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver" />
                                                <VisualTransition GeneratedDuration="00:00:00.1" To="Pressed" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed" />
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="FocusStates">
                                            <VisualState x:Name="Focused">
                                            	<Storyboard>
                                            	   <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                            	</Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Unfocused" />
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <StackPanel Orientation="Horizontal">
                                        <Grid Effect="{StaticResource ControlShadowEffect}" Height="18" Width="18">
                                            <Ellipse x:Name="circle" Fill="{StaticResource ControlBackgroundNormal}" />
                                            <Ellipse x:Name="MouseOverElement" Fill="{StaticResource ControlBackgroundOver}" Opacity="0" />
                                            <Path x:Name="arrow" Data="M0,0 L1,0.5 0,1Z" Fill="#404040" Width="5" Height="8" Stretch="Fill" />
                                        </Grid>
                                        <ContentControl x:Name="header" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Effect="{StaticResource HeaderTextEffect}" FontWeight="Bold" Foreground="{TemplateBinding Foreground}" Grid.Row="1" Margin="6,0,0,0" VerticalAlignment="Center" />
                                    </StackPanel>
                                    <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="False" Margin="-2" Opacity="0" RadiusX="2" RadiusY="2" Stroke="{StaticResource FocusVisualBrush}" StrokeThickness="{StaticResource FocusVisualStrokeThickness}" />
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="ExpanderUpHeaderTemplate" TargetType="ToggleButton">
                                <Grid Background="Transparent">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CheckStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition GeneratedDuration="00:00:00" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Checked">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" To="8" Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="arrow" d:IsOptimized="True" />
                                                    <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="arrow" d:IsOptimized="True" />
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Data" Storyboard.TargetName="arrow">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="M0,1 L1,1 L0.5,0 z" />
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Margin" Storyboard.TargetName="arrow">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0,0,0,2" />
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Unchecked" />
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition GeneratedDuration="0" />
                                                <VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver" />
                                                <VisualTransition GeneratedDuration="00:00:00.1" To="Pressed" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed" />
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="FocusStates">
                                            <VisualState x:Name="Focused" />
                                            <VisualState x:Name="Unfocused" />
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <StackPanel Orientation="Horizontal">
                                        <Grid Effect="{StaticResource ControlShadowEffect}" Height="18" Width="18">
                                            <Ellipse x:Name="circle" Fill="{StaticResource ControlBackgroundNormal}" />
                                            <Ellipse x:Name="MouseOverElement" Fill="{StaticResource ControlBackgroundOver}" Opacity="0" />
                                            <Path x:Name="arrow" Data="M0,0 L1,0.5 0,1Z" Fill="#404040" Width="5" Height="8" Stretch="Fill" />
                                        </Grid>
                                        <ContentControl x:Name="header" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Effect="{StaticResource HeaderTextEffect}" FontWeight="Bold" Foreground="{TemplateBinding Foreground}" Grid.Row="1" Margin="6,0,0,0" VerticalAlignment="Center" />
                                    </StackPanel>
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="ExpanderLeftHeaderTemplate" TargetType="ToggleButton">
                                <Grid Background="Transparent">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CheckStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition GeneratedDuration="00:00:00" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Checked">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="arrow" d:IsOptimized="True" />
                                                    <DoubleAnimation Duration="0" To="8" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="arrow" d:IsOptimized="True" />
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Data" Storyboard.TargetName="arrow">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="M1,0 L1,1 L0,0.5 z" />
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Margin" Storyboard.TargetName="arrow">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0,0,2,0" />
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Unchecked" />
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition GeneratedDuration="0" />
                                                <VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver" />
                                                <VisualTransition GeneratedDuration="00:00:00.1" To="Pressed" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed" />
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="FocusStates">
                                            <VisualState x:Name="Focused" />
                                            <VisualState x:Name="Unfocused" />
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <StackPanel Orientation="Horizontal">
                                        <Grid Effect="{StaticResource ControlShadowEffect}" Height="18" Width="18">
                                            <Ellipse x:Name="circle" Fill="{StaticResource ControlBackgroundNormal}" />
                                            <Ellipse x:Name="MouseOverElement" Fill="{StaticResource ControlBackgroundOver}" Opacity="0" />
                                            <Path x:Name="arrow" Data="M0,0 L1,0.5 0,1Z" Fill="#404040" Width="5" Height="8" Stretch="Fill" />
                                        </Grid>
                                        <ContentControl x:Name="header" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Effect="{StaticResource HeaderTextEffect}" FontWeight="Bold" Foreground="{TemplateBinding Foreground}" Grid.Row="1" Margin="6,0,0,0" VerticalAlignment="Center" />
                                    </StackPanel>
                                </Grid>
                            </ControlTemplate>
                            <ControlTemplate x:Key="ExpanderRightHeaderTemplate" TargetType="ToggleButton">
                                <Grid Background="Transparent">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CheckStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition GeneratedDuration="00:00:00" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Checked">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="arrow" d:IsOptimized="True" />
                                                    <DoubleAnimation Duration="0" To="8" Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="arrow" d:IsOptimized="True" />
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Data" Storyboard.TargetName="arrow">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="M1,0 L1,1 L0,0.5 z" />
                                                    </ObjectAnimationUsingKeyFrames>
                                                    <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Margin" Storyboard.TargetName="arrow">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="0,0,2,0" />
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Unchecked" />
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition GeneratedDuration="0" />
                                                <VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver" />
                                                <VisualTransition GeneratedDuration="00:00:00.1" To="Pressed" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed" />
                                        </VisualStateGroup>
                                        <VisualStateGroup x:Name="FocusStates">
                                            <VisualState x:Name="Focused" />
                                            <VisualState x:Name="Unfocused" />
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <StackPanel Orientation="Horizontal">
                                        <Grid Effect="{StaticResource ControlShadowEffect}" Height="18" Width="18">
                                            <Ellipse x:Name="circle" Fill="{StaticResource ControlBackgroundNormal}" />
                                            <Ellipse x:Name="MouseOverElement" Fill="{StaticResource ControlBackgroundOver}" Opacity="0" />
                                            <Path x:Name="arrow" Data="M0,0 L1,0.5 0,1Z" Fill="#404040" Width="5" Height="8" Stretch="Fill" />
                                        </Grid>
                                        <ContentControl x:Name="header" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Effect="{StaticResource HeaderTextEffect}" FontWeight="Bold" Foreground="{TemplateBinding Foreground}" Grid.Row="1" Margin="6,0,0,0" VerticalAlignment="Center" />
                                    </StackPanel>
                                </Grid>
                            </ControlTemplate>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Background" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpansionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(ExpandableContentControl.Percentage)" Storyboard.TargetName="ExpandSite">
                                            <SplineDoubleKeyFrame KeySpline="0.2,0,0,1" KeyTime="00:00:00.3" Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00.3" Duration="00:00:00" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Collapsed" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(ExpandableContentControl.Percentage)" Storyboard.TargetName="ExpandSite">
                                            <SplineDoubleKeyFrame KeySpline="0.2,0,0,1" KeyTime="00:00:00.3" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpandDirectionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="ExpandDown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd1">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandUp">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Template" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderUpHeaderTemplate}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Margin" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0,0,0,6" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandLeft">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Template" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderLeftHeaderTemplate}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Margin" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0,0,6,0" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandRight">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Template" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ExpanderRightHeaderTemplate}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd1">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Margin" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="6,0,0,0" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="3">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Name="cd0" Width="Auto" />
                                    <ColumnDefinition x:Name="cd1" Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition x:Name="rd0" Height="Auto" />
                                    <RowDefinition x:Name="rd1" Height="Auto" />
                                </Grid.RowDefinitions>
                                <ToggleButton x:Name="ExpanderButton" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Grid.Column="0" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{TemplateBinding IsExpanded}" Margin="1" MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" Grid.Row="0" Template="{StaticResource ExpanderDownHeaderTemplate}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
                                <toolkit:ExpandableContentControl x:Name="ExpandSite" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" Margin="0,6,0,0" Percentage="0" RevealMode="{TemplateBinding ExpandDirection}" Grid.Row="1" VerticalAlignment="{TemplateBinding VerticalAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
	***************************************************************************
	SpinnerStyle (used by the different *UpDown control styles)
	***************************************************************************
	-->

    <Style x:Key="SpinnerStyle" TargetType="toolkit:ButtonSpinner">
        <Setter Property="Background" Value="{StaticResource InputBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Padding" Value="5,4,5,4" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:ButtonSpinner">
                    <Grid d:DesignWidth="100">
                        <Grid.Resources>
                            <ControlTemplate x:Key="UpDownButton" TargetType="RepeatButton">
                                <Grid Background="Transparent">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition GeneratedDuration="0" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver" />
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="PressedBorder" Storyboard.TargetProperty="Opacity" To="1.0" />
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="ContentHost" Storyboard.TargetProperty="Opacity" To="0.5" />
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Border x:Name="PressedBorder" Background="#2000" Opacity="0" />
                                    <ContentPresenter x:Name="ContentHost" />
                                </Grid>
                            </ControlTemplate>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.1" Storyboard.TargetName="MouseOverBackground" Storyboard.TargetProperty="Opacity" To="1.0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Foreground" Storyboard.TargetName="presentationSite">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{StaticResource DisabledBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ElementContainer">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{StaticResource DisabledBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.1" Storyboard.TargetName="MouseOverBackground" Storyboard.TargetProperty="Opacity" To="1.0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="IncreaseStates">
                                <VisualState x:Name="IncreaseEnabled" />
                                <VisualState x:Name="IncreaseDisabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DecreaseStates">
                                <VisualState x:Name="DecreaseEnabled" />
                                <VisualState x:Name="DecreaseDisabled" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ElementContainer" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2.5" Opacity="1">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="24" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <ContentControl x:Name="presentationSite" Content="{TemplateBinding Content}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" Grid.RowSpan="2" Margin="1" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
                                <Button Grid.Column="1" IsHitTestVisible="True" IsTabStop="False" Grid.Row="0" Grid.RowSpan="2">
                                    <Button.Template>
                                        <ControlTemplate TargetType="Button">
                                            <Grid Background="Transparent" />
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                                <Border x:Name="MouseOverBackground" Grid.Column="1" Grid.RowSpan="2" CornerRadius="0,3,2,0" Background="#1000" Opacity="0" IsHitTestVisible="False">
                                    <StackPanel Height="2" VerticalAlignment="Center" Margin="0,0,0,0">
                                        <Rectangle Height="1" Fill="#2000" />
                                        <Rectangle Height="1" Fill="#EFFF" />
                                    </StackPanel>
                                </Border>
                                <RepeatButton x:Name="IncreaseButton" ClickMode="Press" Grid.Column="1" IsTabStop="False" Grid.Row="0" Template="{StaticResource UpDownButton}">
                                    <Path Data="M0,1 L1,1 0.5,0Z" Fill="#404040" Width="7" Height="4" Margin="0,1,0,0" Stretch="Fill" VerticalAlignment="Center" HorizontalAlignment="Center" />
                                </RepeatButton>
                                <RepeatButton x:Name="DecreaseButton" ClickMode="Press" Grid.Column="1" IsTabStop="False" Grid.Row="1" Template="{StaticResource UpDownButton}">
                                    <Path Data="M0,0 L1,0 0.5,1Z" Fill="#404040" Width="7" Height="4" Margin="0,0,0,0" Stretch="Fill" VerticalAlignment="Center" HorizontalAlignment="Center" />
                                </RepeatButton>
                            </Grid>
                        </Border>
                        <Border x:Name="OuterHighlight" BorderBrush="{StaticResource ControlOuterHighlightBrush}" BorderThickness="0,0,1,1" CornerRadius="3" Margin="0,0,-1,-1" />
                        <Border x:Name="InnerShadowDark" BorderBrush="{StaticResource InnerShadowDarkBrush}" BorderThickness="1,1,0,0" CornerRadius="2" Margin="1" />
                        <Border x:Name="InnerShadowLight" BorderBrush="{StaticResource InnerShadowLightBrush}" BorderThickness="1,1,0,0" CornerRadius="1" Margin="2" />
                        <Border x:Name="DisabledVisualElement" Background="#50000000" IsHitTestVisible="False" Margin="1" Opacity="0" CornerRadius="2" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
	***************************************************************************
	NumericUpDown
	***************************************************************************
	-->

    <Style TargetType="toolkit:NumericUpDown">
        <Setter Property="Background" Value="{StaticResource InputBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="SpinnerStyle" Value="{StaticResource SpinnerStyle}" />
        <Setter Property="Foreground" Value="{StaticResource InputForegroundBrush}" />
        <Setter Property="Height" Value="Auto" />
        <Setter Property="Padding" Value="5,4,5,4" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:NumericUpDown">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualElement" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                	<Storyboard>
                                	   <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                	</Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen" Storyboard.TargetName="validationTooltip">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Boolean>True</System:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <toolkit:ButtonSpinner x:Name="Spinner" HorizontalContentAlignment="Stretch" MinWidth="35" Style="{TemplateBinding SpinnerStyle}" VerticalContentAlignment="Stretch">
                            <TextBox x:Name="Text" AcceptsReturn="False" BorderThickness="1" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" Padding="{TemplateBinding Padding}" MinWidth="20" SelectionBackground="{StaticResource InputSelectionBrush}" TextAlignment="Left" TextWrapping="NoWrap" Text="{TemplateBinding Value}">
                                <TextBox.Style>
                                    <Style TargetType="TextBox">
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="TextBox">
                                                    <ScrollViewer x:Name="ContentElement" BorderThickness="0" Padding="{TemplateBinding Padding}" />
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </TextBox.Style>
                            </TextBox>
                        </toolkit:ButtonSpinner>
                        <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" CornerRadius="2" IsHitTestVisible="false" Opacity="0" />
                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="False" Margin="1" Opacity="0" RadiusX="1" RadiusY="1" Stroke="{StaticResource FocusVisualBrush}" StrokeThickness="{StaticResource FocusVisualStrokeThickness}" />
                        <Border x:Name="ValidationErrorElement" BorderBrush="{StaticResource ErrorBrush}" BorderThickness="1" CornerRadius="3" Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}">
                                    <ToolTip.Triggers>
                                        <EventTrigger RoutedEvent="Canvas.Loaded">
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="validationTooltip">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="True" />
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger>
                                    </ToolTip.Triggers>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                            <Grid Background="Transparent" HorizontalAlignment="Right" Height="12" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12">
                                <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" Fill="{StaticResource ErrorBrush}" Margin="1,3,0,0" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
	***************************************************************************
	DomainUpDown
	***************************************************************************
	-->

    <Style TargetType="toolkit:DomainUpDown">
        <Setter Property="Background" Value="{StaticResource InputBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="SpinnerStyle" Value="{StaticResource SpinnerStyle}" />
        <Setter Property="Foreground" Value="{StaticResource InputForegroundBrush}" />
        <Setter Property="Height" Value="Auto" />
        <Setter Property="Padding" Value="5,4,5,4" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:DomainUpDown">
                    <Grid x:Name="RootElement">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualElement" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                	<Storyboard>
                                	   <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                	</Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="InteractionModeStates">
                                <VisualState x:Name="Edit">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Text" />
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Visualization" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Display" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DomainStates">
                                <VisualState x:Name="ValidDomain" />
                                <VisualState x:Name="InvalidDomain">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <toolkit:ButtonSpinner x:Name="Spinner" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" IsTabStop="False" Padding="{TemplateBinding Padding}" Style="{TemplateBinding SpinnerStyle}" TabIndex="3" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch">
                            <Grid>
                                <ContentControl x:Name="Visualization" ContentTemplate="{TemplateBinding ItemTemplate}" Content="{TemplateBinding Value}" Foreground="{TemplateBinding Foreground}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="False" IsTabStop="False" Margin="0" Opacity="1" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                <TextBox x:Name="Text" AcceptsReturn="False" BorderThickness="0" Background="Red" Foreground="{TemplateBinding Foreground}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="False" IsTabStop="True" Margin="0" Opacity="0" Padding="{TemplateBinding Padding}" SelectionBackground="{StaticResource InputSelectionBrush}" TextWrapping="NoWrap" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                    <TextBox.Style>
                                        <Style TargetType="TextBox">
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="TextBox">
                                                        <ScrollViewer x:Name="ContentElement" BorderThickness="0" Padding="{TemplateBinding Padding}" />
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </TextBox.Style>
                                </TextBox>
                            </Grid>
                        </toolkit:ButtonSpinner>
                        <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" CornerRadius="2" IsHitTestVisible="false" Opacity="0" />
                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="False" Margin="1" Opacity="0" RadiusX="1" RadiusY="1" Stroke="{StaticResource FocusVisualBrush}" StrokeThickness="{StaticResource FocusVisualStrokeThickness}" />
                        <Border x:Name="ValidationErrorElement" BorderBrush="{StaticResource ErrorBrush}" BorderThickness="1" CornerRadius="3" Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}">
                                    <ToolTip.Triggers>
                                        <EventTrigger RoutedEvent="Canvas.Loaded">
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="validationTooltip">
                                                        <DiscreteObjectKeyFrame KeyTime="0" Value="True" />
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger>
                                    </ToolTip.Triggers>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                            <Grid Background="Transparent" HorizontalAlignment="Right" Height="12" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12">
                                <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" Fill="{StaticResource ErrorBrush}" Margin="1,3,0,0" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
	***************************************************************************
	TimeUpDown
	***************************************************************************
	-->

    <Style TargetType="toolkit:TimeUpDown">
        <Setter Property="Background" Value="{StaticResource InputBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Foreground" Value="{StaticResource InputForegroundBrush}" />
        <Setter Property="Height" Value="Auto" />
        <Setter Property="Padding" Value="5,4,5,4" />
        <Setter Property="SpinnerStyle" Value="{StaticResource SpinnerStyle}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:TimeUpDown">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisualElement" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                	<Storyboard>
                                	   <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                	</Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="TimeHintStates">
                                <VisualState x:Name="TimeHintOpenedUp">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="TimeHintVisualElement">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="TimeHintVisualElement">
                                            <SplineDoubleKeyFrame KeySpline="0,0,0,1" KeyTime="00:00:00.200" Value="-23" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="Height" Storyboard.TargetName="TimeHintVisualElement">
                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                            <SplineDoubleKeyFrame KeySpline="0,0,0,1" KeyTime="00:00:00.200" Value="22" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="TimeHintOpenedDown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="TimeHintVisualElement">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="TimeHintVisualElement">
                                            <SplineDoubleKeyFrame KeySpline="0,0,0,1" KeyTime="00:00:00.200" Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="Height" Storyboard.TargetName="TimeHintVisualElement">
                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                            <SplineDoubleKeyFrame KeySpline="0,0,0,1" KeyTime="00:00:00.200" Value="22" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="TimeHintClosed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="TimeHintVisualElement">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:20" Value="Collapsed" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="TimeHintVisualElement">
                                            <SplineDoubleKeyFrame KeySpline="0,0,0,1" KeyTime="00:00:00.200" Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="Height" Storyboard.TargetName="TimeHintVisualElement">
                                            <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="22" />
                                            <SplineDoubleKeyFrame KeySpline="0,0,0,1" KeyTime="00:00:00.200" Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ParsingStates">
                                <VisualState x:Name="ValidTime">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="validicon">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidTime">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="invalidicon">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="EmptyTime">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="emptyicon">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidFocused" />
                                <VisualState x:Name="InvalidUnfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Popup x:Name="TimeHintPopup" VerticalOffset="0">
                            <Border x:Name="TimeHintVisualElement" BorderBrush="Gray" BorderThickness="1" Background="White" HorizontalAlignment="Left" IsHitTestVisible="True" Visibility="Collapsed">
                                <Border.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform />
                                        <SkewTransform />
                                        <RotateTransform />
                                        <TranslateTransform />
                                    </TransformGroup>
                                </Border.RenderTransform>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition MinWidth="15" Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <ContentControl Content="{TemplateBinding TimeHintContent}" Grid.Column="0" Foreground="#FF4A4A4A" FontSize="10" HorizontalAlignment="Right" IsHitTestVisible="False" IsTabStop="False" Margin="3" VerticalAlignment="Center" />
                                    <ContentControl x:Name="emptyicon" Grid.Column="1" IsHitTestVisible="False" IsTabStop="False" Margin="3" Visibility="Collapsed" />
                                    <ContentControl x:Name="validicon" Grid.Column="1" IsHitTestVisible="False" IsTabStop="False" Margin="3" Visibility="Collapsed" />
                                    <ContentControl x:Name="invalidicon" Grid.Column="1" IsHitTestVisible="False" IsTabStop="False" Visibility="Collapsed" VerticalAlignment="Center">
                                        <Grid Height="13" VerticalAlignment="Bottom" Width="10">
                                            <Path Data="F1 M 28.1143,29.4857L 28.1143,27.4286L 20.7612,13.0286L 19.3898,13.0286L 12.3429,27.4286L 12.3429,29.4857L 28.1143,29.4857 Z " HorizontalAlignment="Stretch" Height="11.833" StrokeStartLineCap="Round" Stretch="Fill" StrokeEndLineCap="Round" StrokeLineJoin="Bevel" VerticalAlignment="Top">
                                                <Path.Fill>
                                                    <LinearGradientBrush EndPoint="-0.140331,0.460318" StartPoint="1.13883,0.460318">
                                                        <GradientStop Color="#FFF7F79F" Offset="0.123636" />
                                                        <GradientStop Color="#FBFBFB7D" Offset="0.177662" />
                                                        <GradientStop Color="#F6FFFF5B" Offset="0.24" />
                                                        <GradientStop Color="#E7CAA709" Offset="0.52" />
                                                        <GradientStop Color="#9ADABE0C" Offset="0.941376" />
                                                        <GradientStop Color="#4DEBD60F" Offset="0.941818" />
                                                        <GradientStop Color="#FBF6EC20" Offset="0.956364" />
                                                        <GradientStop Color="#FFFFFF2F" Offset="0.963636" />
                                                    </LinearGradientBrush>
                                                </Path.Fill>
                                                <Path.Stroke>
                                                    <LinearGradientBrush EndPoint="-0.102151,0.462591" StartPoint="1.10074,0.462591">
                                                        <GradientStop Color="#F6CAA709" Offset="0.0436364" />
                                                        <GradientStop Color="#F3F7F34F" Offset="0.149091" />
                                                        <GradientStop Color="#E7CAA709" Offset="0.825455" />
                                                        <GradientStop Color="#E7967C07" Offset="0.967124" />
                                                        <GradientStop Color="#E7625106" Offset="0.967273" />
                                                    </LinearGradientBrush>
                                                </Path.Stroke>
                                            </Path>
                                            <Path Data="F1 M 18.6937,17.3004L 22.2563,17.3004L 21.1313,23.6937L 19.8563,23.6937L 18.6937,17.3004 Z " Height="4.683" Margin="4.25,2.25,3.75,0" StrokeStartLineCap="Round" Stretch="Fill" StrokeEndLineCap="Round" Stroke="#FF1B1B54" StrokeThickness="0.3" StrokeLineJoin="Bevel" VerticalAlignment="Top">
                                                <Path.Fill>
                                                    <LinearGradientBrush EndPoint="1.4,0.50126" StartPoint="-0.400002,0.50126">
                                                        <GradientStop Color="#FFF7F79F" Offset="0.123636" />
                                                        <GradientStop Color="#FB8F8873" Offset="0.175974" />
                                                        <GradientStop Color="#F6271A47" Offset="0.236364" />
                                                        <GradientStop Color="#E7271A47" Offset="0.534545" />
                                                        <GradientStop Color="#9A89782B" Offset="0.941391" />
                                                        <GradientStop Color="#4DEBD60F" Offset="0.941818" />
                                                        <GradientStop Color="#FBF6EC20" Offset="0.956364" />
                                                        <GradientStop Color="#FFFFFF2F" Offset="0.963636" />
                                                    </LinearGradientBrush>
                                                </Path.Fill>
                                            </Path>
                                            <Path Data="F1 M 20.225,25.122L 20.725,25.122C 21.2773,25.122 21.725,25.5697 21.725,26.122L 21.725,26.872C 21.725,27.4243 21.2773,27.872 20.725,27.872L 20.225,27.872C 19.6727,27.872 19.225,27.4243 19.225,26.872L 19.225,26.122C 19.225,25.5697 19.6727,25.122 20.225,25.122 Z " Height="3.11" Margin="3.833,0,4.167,0.833" StrokeStartLineCap="Round" Stretch="Fill" StrokeEndLineCap="Round" Stroke="#FF1C1C50" StrokeThickness="0.3" StrokeLineJoin="Round" VerticalAlignment="Bottom">
                                                <Path.Fill>
                                                    <LinearGradientBrush EndPoint="1.06,0.5" StartPoint="-0.0599991,0.5">
                                                        <GradientStop Color="#F6271A47" Offset="0.236364" />
                                                        <GradientStop Color="#E7271A47" Offset="0.534545" />
                                                        <GradientStop Color="#9A89782B" Offset="0.98135" />
                                                        <GradientStop Color="#4DEBD60F" Offset="0.981818" />
                                                    </LinearGradientBrush>
                                                </Path.Fill>
                                            </Path>
                                        </Grid>
                                    </ContentControl>
                                </Grid>
                            </Border>
                        </Popup>
                        <toolkit:ButtonSpinner x:Name="Spinner" HorizontalContentAlignment="Stretch" MinWidth="35" Style="{TemplateBinding SpinnerStyle}" VerticalContentAlignment="Stretch">
                            <TextBox x:Name="Text" AcceptsReturn="False" BorderThickness="1" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" Padding="{TemplateBinding Padding}" MinWidth="20" SelectionBackground="{StaticResource InputSelectionBrush}" TextAlignment="Left" TextWrapping="NoWrap" Text="{TemplateBinding Value}">
                                <TextBox.Style>
                                    <Style TargetType="TextBox">
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="TextBox">
                                                    <ScrollViewer x:Name="ContentElement" BorderThickness="0" Padding="{TemplateBinding Padding}" />
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </TextBox.Style>
                            </TextBox>
                        </toolkit:ButtonSpinner>
                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="False" Margin="1" Opacity="0" RadiusX="1" RadiusY="1" Stroke="{StaticResource FocusVisualBrush}" StrokeThickness="{StaticResource FocusVisualStrokeThickness}" />
                        <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" CornerRadius="2" IsHitTestVisible="false" Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
	***************************************************************************
	Rating (including RatingItem style)
	***************************************************************************
	-->

    <Style x:Key="RatingItemStyle" TargetType="toolkit:RatingItem">
    	
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:RatingItem">
                    <Grid Background="Transparent" Height="20" Width="21">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="20" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.2000000" />
                                    <VisualTransition From="MouseOver" GeneratedDuration="00:00:00.2000000" To="Normal" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Disabled" />
                                <VisualState x:Name="ReadOnly" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.1000000" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Focused">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FillStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.1000000" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Empty" />
                                <VisualState x:Name="Partial" />
                                <VisualState x:Name="Filled" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="DefaultRatingItem" Margin="2">
                            <Path Fill="#44000000" Stretch="Fill" Data="F1 M 412.75,172.5C 412.66,172.21 412.39,172.01 412.08,172.01L 399.29,172.01L 395.33,159.85C 395.24,159.56 394.97,159.36 394.66,159.36C 394.36,159.36 394.09,159.56 393.99,159.85L 390.01,172.01L 377.24,172.01C 376.94,172.01 376.66,172.21 376.57,172.5C 376.48,172.78 376.58,173.10 376.82,173.28L 387.16,180.81L 383.18,193.04C 383.08,193.33 383.19,193.65 383.43,193.83C 383.68,194.01 384.01,194.01 384.26,193.83L 394.66,186.28L 405.04,193.83C 405.17,193.92 405.31,193.96 405.45,193.96C 405.60,193.96 405.74,193.92 405.87,193.83C 406.12,193.65 406.22,193.33 406.13,193.04L 402.14,180.81L 412.50,173.28C 412.74,173.10 412.85,172.78 412.75,172.5 Z" />
                            <Grid Clip="M16.982708,6.0754223 C16.940502,5.9413404 16.813885,5.8488626 16.668489,5.8488626 L10.670356,5.8488626 L8.8132191,0.22655855 C8.7710133,0.092469923 8.6443958,-8.6220638E-07 8.4990158,-8.6220638E-07 C8.3583155,-8.6220638E-07 8.231699,0.092469923 8.1847992,0.22655855 L6.3183017,5.8488626 L0.32952729,5.8488626 C0.18884158,5.8488626 0.057530161,5.9413404 0.015324448,6.0754223 C-0.026881263,6.2048826 0.020004431,6.3528414 0.1325673,6.4360633 L4.98173,9.9176407 L3.1152186,15.572313 C3.0683188,15.706402 3.1199131,15.854354 3.2324617,15.937583 C3.3497045,16.020803 3.504473,16.020803 3.6217158,15.937583 L8.4990158,12.446755 L13.366941,15.937583 C13.42791,15.979194 13.493559,15.997692 13.559221,15.997692 C13.629564,15.997692 13.695213,15.979194 13.756182,15.937583 C13.873425,15.854354 13.920324,15.706402 13.878119,15.572313 L12.006927,9.9176407 L16.865465,6.4360633 C16.978014,6.3528414 17.029608,6.2048826 16.982708,6.0754223 z">
                                <Path Margin="0,1,0,-1" Stroke="#DD000000" Stretch="Fill" Data="F1 M 412.75,172.5C 412.66,172.21 412.39,172.01 412.08,172.01L 399.29,172.01L 395.33,159.85C 395.24,159.56 394.97,159.36 394.66,159.36C 394.36,159.36 394.09,159.56 393.99,159.85L 390.01,172.01L 377.24,172.01C 376.94,172.01 376.66,172.21 376.57,172.5C 376.48,172.78 376.58,173.10 376.82,173.28L 387.16,180.81L 383.18,193.04C 383.08,193.33 383.19,193.65 383.43,193.83C 383.68,194.01 384.01,194.01 384.26,193.83L 394.66,186.28L 405.04,193.83C 405.17,193.92 405.31,193.96 405.45,193.96C 405.60,193.96 405.74,193.92 405.87,193.83C 406.12,193.65 406.22,193.33 406.13,193.04L 402.14,180.81L 412.50,173.28C 412.74,173.10 412.85,172.78 412.75,172.5 Z">
                                    <Path.Effect>
                                        <BlurEffect Radius="2" />
                                    </Path.Effect>
                                </Path>
                            </Grid>
                        </Grid>
                        <prim:LinearClipper x:Name="Clipper" ExpandDirection="Right" Margin="{TemplateBinding Padding}" RatioVisible="{TemplateBinding DisplayValue}">
                            <Path Margin="2" Data="M16.982708,6.0754223 C16.940502,5.9413404 16.813885,5.8488626 16.668489,5.8488626 L10.670356,5.8488626 L8.8132191,0.22655855 C8.7710133,0.092469923 8.6443958,-8.6220638E-07 8.4990158,-8.6220638E-07 C8.3583155,-8.6220638E-07 8.231699,0.092469923 8.1847992,0.22655855 L6.3183017,5.8488626 L0.32952729,5.8488626 C0.18884158,5.8488626 0.057530161,5.9413404 0.015324448,6.0754223 C-0.026881263,6.2048826 0.020004431,6.3528414 0.1325673,6.4360633 L4.98173,9.9176407 L3.1152186,15.572313 C3.0683188,15.706402 3.1199131,15.854354 3.2324617,15.937583 C3.3497045,16.020803 3.504473,16.020803 3.6217158,15.937583 L8.4990158,12.446755 L13.366941,15.937583 C13.42791,15.979194 13.493559,15.997692 13.559221,15.997692 C13.629564,15.997692 13.695213,15.979194 13.756182,15.937583 C13.873425,15.854354 13.920324,15.706402 13.878119,15.572313 L12.006927,9.9176407 L16.865465,6.4360633 C16.978014,6.3528414 17.029608,6.2048826 16.982708,6.0754223 z" Fill="{TemplateBinding Foreground}" Opacity="1" Stretch="Fill" Stroke="{x:Null}" StrokeLineJoin="Round" UseLayoutRounding="False" VerticalAlignment="Stretch">
                                <Path.Effect>
                                    <DropShadowEffect ShadowDepth="1" BlurRadius="2" Direction="-90" Opacity="0.75" />
                                </Path.Effect>
                            </Path>
                        </prim:LinearClipper>
                        <ContentPresenter x:Name="Content" Cursor="{TemplateBinding Cursor}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="toolkit:Rating">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="{x:Null}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Foreground" Value="{StaticResource ColorAccentHighlightBrush}" />
        <Setter Property="ItemContainerStyle" Value="{StaticResource RatingItemStyle}" />
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:Rating">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="itemsPresenter" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ReadOnly">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.75" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="itemsPresenter" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                            <ItemsPresenter x:Name="itemsPresenter" />
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
    ***************************************************************************
    TimePicker (inlcuding TimePopupButtonTemplate)
    ***************************************************************************
    -->

    <ControlTemplate x:Key="TimePopupButtonTemplate" TargetType="ToggleButton">
        <Grid FlowDirection="LeftToRight">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0" />
                        <VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver" />
                        <VisualTransition GeneratedDuration="0:0:0.1" To="Pressed" />
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0" />
                            <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="NormalElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0.25" />
                            <DoubleAnimation Duration="0" Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                            <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0" />
                            <DoubleAnimation Duration="0" Storyboard.TargetName="HighlightElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0.5" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisual">
                                <SplineDoubleKeyFrame KeyTime="0" Value="0.55" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid Width="26" Height="24" VerticalAlignment="Top">
                <Border CornerRadius="1">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFFFFFFF" Offset="0.65" />
                            <GradientStop Color="#FFF2F2F2" Offset="0.90" />
                            <GradientStop Color="#FFDADADA" Offset="1" />
                        </LinearGradientBrush>
                    </Border.Background>
                    <Border.Effect>
                        <DropShadowEffect Color="#55524f" ShadowDepth="2" BlurRadius="3" Opacity="0.5" />
                    </Border.Effect>
                </Border>
                <Border x:Name="NormalElement" Height="6" VerticalAlignment="Top" CornerRadius="1,1,0,0" Background="{StaticResource ControlBackgroundNormalGreen}" />
                <Canvas Margin="2,8,2,2">
                    <Ellipse Stroke="#606060" Width="14" Height="14" StrokeThickness="1" Canvas.Left="4">
                        <Ellipse.Fill>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFD4D4D4" Offset="1" />
                                <GradientStop Color="White" />
                            </LinearGradientBrush>
                        </Ellipse.Fill>
                    </Ellipse>
                    <Rectangle Fill="#606060" Width="5" Height="1" Canvas.Top="6" Canvas.Left="10" />
                    <Rectangle Fill="#606060" Width="1" Height="5" Canvas.Top="6" Canvas.Left="10" />
                </Canvas>
                <Border x:Name="MouseOverElement" Height="6" Background="{StaticResource ControlBackgroundOverGreen}" CornerRadius="2,2,0,0" Opacity="0" VerticalAlignment="Top" />
                <Border x:Name="PressedElement" Height="6" Background="{StaticResource ControlBackgroundPressedGreen}" CornerRadius="2,2,0,0" Opacity="0" VerticalAlignment="Top" />
                <Border x:Name="HighlightElement" Height="6" BorderBrush="{StaticResource HighlightBrushGreen}" BorderThickness="0.5,1,0,0" CornerRadius="1,1,0,0" VerticalAlignment="Top" />
                <Border x:Name="DisabledVisual" Background="{StaticResource DisabledBrush}" CornerRadius="1,1,0,0" Opacity="0" />
            </Grid>
        </Grid>
    </ControlTemplate>
    <Style TargetType="toolkit:TimePicker">
        <Setter Property="Background" Value="{StaticResource InputBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Foreground" Value="{StaticResource InputForegroundBrush}" />
        <Setter Property="Height" Value="27" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="MinWidth" Value="125" />
        <Setter Property="Padding" Value="5,4,5,4" />
        <Setter Property="SpinnerStyle" Value="{StaticResource SpinnerStyle}" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="PopupTemplate">
            <Setter.Value>
                <toolkit:TimePickerPopupTemplate>
                    <toolkit:ListTimePickerPopup />
                </toolkit:TimePickerPopupTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:TimePicker">
                    <Grid x:Name="RootElement">
                        <Grid.Resources>
                            <ControlTemplate x:Key="TimePopupButtonTemplate" TargetType="ToggleButton">
                                <Grid FlowDirection="LeftToRight">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition GeneratedDuration="0" />
                                                <VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver" />
                                                <VisualTransition GeneratedDuration="0:0:0.1" To="Pressed" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0" />
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="NormalElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0.25" />
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0" />
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="HighlightElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0.5" />
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisual">
                                                        <SplineDoubleKeyFrame KeyTime="0" Value="0.55" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Grid Width="26" Height="24" VerticalAlignment="Top">
                                        <Border CornerRadius="1">
                                            <Border.Background>
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                    <GradientStop Color="#FFFFFFFF" Offset="0.65" />
                                                    <GradientStop Color="#FFF2F2F2" Offset="0.90" />
                                                    <GradientStop Color="#FFDADADA" Offset="1" />
                                                </LinearGradientBrush>
                                            </Border.Background>
                                            <Border.Effect>
                                                <DropShadowEffect Color="#55524f" ShadowDepth="2" BlurRadius="3" Opacity="0.5" />
                                            </Border.Effect>
                                        </Border>
                                        <Border x:Name="NormalElement" Height="6" VerticalAlignment="Top" CornerRadius="1,1,0,0" Background="{StaticResource ColorAccentBrush}" />
                                        <Canvas Margin="2,8,2,2">
                                            <Ellipse Stroke="#606060" Width="14" Height="14" StrokeThickness="1" Canvas.Left="4">
                                                <Ellipse.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#FFD4D4D4" Offset="1" />
                                                        <GradientStop Color="White" />
                                                    </LinearGradientBrush>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <Rectangle Fill="#606060" Width="5" Height="1" Canvas.Top="6" Canvas.Left="10" />
                                            <Rectangle Fill="#606060" Width="1" Height="5" Canvas.Top="6" Canvas.Left="10" />
                                        </Canvas>
                                        <Border x:Name="MouseOverElement" Height="6" Background="{StaticResource ColorAccentOverBrush}" CornerRadius="2,2,0,0" Opacity="0" VerticalAlignment="Top" />
                                        <Border x:Name="PressedElement" Height="6" Background="{StaticResource ColorAccentSubduedBrush}" CornerRadius="2,2,0,0" Opacity="0" VerticalAlignment="Top" />
                                        <Border x:Name="HighlightElement" Height="6" BorderBrush="{StaticResource ColorAccentHighlightBrush}" BorderThickness="0.5,1,0,0" CornerRadius="1,1,0,0" VerticalAlignment="Top" />
                                        <Border x:Name="DisabledVisual" Background="{StaticResource DisabledBrush}" CornerRadius="1,1,0,0" Opacity="0" />
                                    </Grid>
                                </Grid>
                            </ControlTemplate>
                        </Grid.Resources>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled" />
                                <VisualState x:Name="Pressed" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="PopupStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.1" To="PopupOpened" />
                                    <VisualTransition GeneratedDuration="0:0:0.2" To="PopupClosed" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="PopupOpened">
                                    <Storyboard>
                                        <DoubleAnimation To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PopupRoot" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PopupClosed">
                                    <Storyboard>
                                        <DoubleAnimation To="0.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PopupRoot" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <toolkit:TimeUpDown x:Name="TimeUpDown" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Culture="{TemplateBinding Culture}" Grid.Column="0" Format="{TemplateBinding Format}" Maximum="{TemplateBinding Maximum}" Minimum="{TemplateBinding Minimum}" Padding="{TemplateBinding Padding}" SpinnerStyle="{TemplateBinding SpinnerStyle}" TimeParsers="{TemplateBinding TimeParsers}" TimeGlobalizationInfo="{TemplateBinding TimeGlobalizationInfo}" />
                        <ToggleButton x:Name="DropDownToggle" Grid.Column="1" HorizontalAlignment="Center" Margin="3,0,0,0" Template="{StaticResource TimePopupButtonTemplate}" VerticalAlignment="Center" />
                        <Popup x:Name="Popup" HorizontalAlignment="Left">
                            <Border x:Name="PopupRoot" BorderThickness="0">
                                <ContentControl x:Name="PopupPlaceHolder" HorizontalContentAlignment="Stretch" IsTabStop="False" VerticalContentAlignment="Stretch" />
                            </Border>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
    ***************************************************************************
    BusyIndicator
    ***************************************************************************
    -->

    <Style TargetType="toolkit:BusyIndicator">
        <Setter Property="Background" Value="#FFF0F0F0" />
        <Setter Property="BorderBrush" Value="{StaticResource DarkBorder}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BusyContent" Value="Please wait..." />
        <Setter Property="DisplayAfter" Value="00:00:00.1" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="OverlayStyle">
            <Setter.Value>
                <Style TargetType="Rectangle">
                    <Setter Property="Fill" Value="#60000000" />
                    <Setter Property="Opacity" Value="1" />
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="ProgressBarStyle">
            <Setter.Value>
                <Style TargetType="ProgressBar">
                    <Setter Property="Background" Value="{StaticResource ControlBackgroundAltBrush}" />
                    <Setter Property="BorderThickness" Value="0" />
                    <Setter Property="Foreground" Value="{StaticResource ColorAccentBrush}" />
                    <Setter Property="Height" Value="10" />
                    <Setter Property="IsIndeterminate" Value="True" />
                    <Setter Property="IsTabStop" Value="False" />
                    <Setter Property="Margin" Value="0,12,0,0" />
                    <Setter Property="Template" Value="{StaticResource ProgressBarTemplate}" />
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:BusyIndicator">
                    <Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="VisibilityStates">
                                <VisualState x:Name="Hidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="busycontent">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Collapsed" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="overlay">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Collapsed" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Visible">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="busycontent">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="overlay">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BusyStatusStates">
                                <VisualState x:Name="Idle">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="content">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Boolean>True</System:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Busy">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="content">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Boolean>False</System:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentControl x:Name="content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
                        <Rectangle x:Name="overlay" Style="{TemplateBinding OverlayStyle}" Stroke="{StaticResource ColorAccentSubduedBrush}" />
                        <ContentPresenter x:Name="busycontent" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <Border CornerRadius="4" Background="{TemplateBinding Background}" BorderBrush="{StaticResource DarkBorder}" BorderThickness="1" MinWidth="160" MinHeight="60" Margin="10" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                                <Border.Effect>
                                    <DropShadowEffect Opacity="0.4" ShadowDepth="20" BlurRadius="20" />
                                </Border.Effect>
                                <Grid Margin="12">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <ContentPresenter ContentTemplate="{TemplateBinding BusyContentTemplate}" Content="{TemplateBinding BusyContent}" VerticalAlignment="Center" />
                                    <ProgressBar Grid.Row="1" Style="{TemplateBinding ProgressBarStyle}" />
                                </Grid>
                            </Border>
                        </ContentPresenter>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
    ***************************************************************************
    Accordion (including AccordionItem and a style for AccordionButton)
    ***************************************************************************
    -->

    <Style x:Key="AccordionButtonStyle" TargetType="toolkit:AccordionButton">
        <Setter Property="BorderBrush" Value="{StaticResource DarkBorder}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Background" Value="{StaticResource StaticControlBackground}" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="IsTabStop" Value="True" />
        <Setter Property="TabNavigation" Value="Once" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:AccordionButton">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ExpandDirectionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="ExpandDown" />
                                <VisualState x:Name="ExpandUp" />
                                <VisualState x:Name="ExpandLeft" />
                                <VisualState x:Name="ExpandRight" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpansionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <DoubleAnimation BeginTime="00:00:00" Duration="00:00:00.3" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" Storyboard.TargetName="icon" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <DoubleAnimation BeginTime="00:00:00" Duration="00:00:00.3" To="90" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" Storyboard.TargetName="icon" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Checked" />
                                <VisualState x:Name="Unchecked" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                    <VisualTransition From="MouseOver" GeneratedDuration="00:00:00.1" To="Normal" />
                                    <VisualTransition GeneratedDuration="00:00:00.1" To="MouseOver" />
                                    <VisualTransition GeneratedDuration="00:00:00.1" To="Pressed" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverElement">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PressedElement">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard />
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="0">
                            <Grid>
                                <Border x:Name="MouseOverElement" Background="{StaticResource ControlBackgroundOver}" CornerRadius="0" Height="Auto" Margin="0" Opacity="0" VerticalAlignment="Stretch" />
                                <Border x:Name="PressedElement" Background="{StaticResource ControlBackgroundPressed}" CornerRadius="0" Height="Auto" Margin="0" Opacity="0" VerticalAlignment="Stretch" />
                                <StackPanel Orientation="Horizontal">
                                    <Grid x:Name="icon" Margin="12,0,0,0" RenderTransformOrigin="0.5,0.5">
                                        <Grid.RenderTransform>
                                            <RotateTransform Angle="0" />
                                        </Grid.RenderTransform>
                                        <Path x:Name="arrow" Data="M0,0 L1,0.5 0,1Z" Width="5" Height="8" Fill="#404040" RenderTransformOrigin="0.35,0.5" Stretch="Fill">
                                            <Path.RenderTransform>
                                                <RotateTransform Angle="0" />
                                            </Path.RenderTransform>
                                        </Path>
                                    </Grid>
                                    <toolkit:LayoutTransformer x:Name="header" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="8,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                </StackPanel>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="toolkit:AccordionItem">
        <Setter Property="AccordionButtonStyle" Value="{StaticResource AccordionButtonStyle}" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="{StaticResource DarkBorder}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="FontWeight" Value="Bold" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="Padding" Value="1,0,1,1" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:AccordionItem">
                    <Grid Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Margin="{TemplateBinding Margin}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                	<Storyboard>
                                	   <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                	</Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpansionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(ExpandableContentControl.Percentage)" Storyboard.TargetName="ExpandSite">
                                            <SplineDoubleKeyFrame KeySpline="0.2,0,0,1" KeyTime="00:00:00.3" Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00.3" Duration="00:00:00" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Collapsed" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(ExpandableContentControl.Percentage)" Storyboard.TargetName="ExpandSite">
                                            <SplineDoubleKeyFrame KeySpline="0.2,0,0,1" KeyTime="00:00:00.3" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="LockedStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Locked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="False" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unlocked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="True" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpandDirectionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="ExpandDown">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(LayoutTransformer.LayoutTransform).(RotateTransform.Angle)" Storyboard.TargetName="layoutTransformer" d:IsOptimized="True" />
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandUp">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(LayoutTransformer.LayoutTransform).(RotateTransform.Angle)" Storyboard.TargetName="layoutTransformer" d:IsOptimized="True" />
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd1">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="layoutTransformer">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandLeft">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="-90" Storyboard.TargetProperty="(LayoutTransformer.LayoutTransform).(RotateTransform.Angle)" Storyboard.TargetName="layoutTransformer" d:IsOptimized="True" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="layoutTransformer">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd1">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ExpandRight">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="-90" Storyboard.TargetProperty="(LayoutTransformer.LayoutTransform).(RotateTransform.Angle)" Storyboard.TargetName="layoutTransformer" d:IsOptimized="True" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Row)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Grid.Column)" Storyboard.TargetName="ExpandSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="1" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Width" Storyboard.TargetName="cd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Height" Storyboard.TargetName="rd0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="*" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Name="cd0" Width="Auto" />
                                    <ColumnDefinition x:Name="cd1" Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition x:Name="rd0" Height="Auto" />
                                    <RowDefinition x:Name="rd1" Height="Auto" />
                                </Grid.RowDefinitions>
                                <toolkit:LayoutTransformer x:Name="layoutTransformer" Grid.Row="0" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Margin="1,0,1,1" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                                    <toolkit:LayoutTransformer.LayoutTransform>
                                        <RotateTransform Angle="0" />
                                    </toolkit:LayoutTransformer.LayoutTransform>
                                    <toolkit:AccordionButton x:Name="ExpanderButton" Background="{StaticResource StaticControlBackground}" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalContentAlignment="Left" IsTabStop="True" IsChecked="{TemplateBinding IsSelected}" Margin="0" Padding="0" Height="28" Style="{TemplateBinding AccordionButtonStyle}" VerticalContentAlignment="Center" />
                                </toolkit:LayoutTransformer>
                                <toolkit:ExpandableContentControl x:Name="ExpandSite" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" Margin="0" Percentage="0" RevealMode="{TemplateBinding ExpandDirection}" Grid.Row="1" Style="{TemplateBinding ExpandableContentControlStyle}" VerticalAlignment="{TemplateBinding VerticalAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
                                <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="False" Margin="1" Opacity="0" RadiusX="1" RadiusY="1" Stroke="{StaticResource FocusVisualBrush}" StrokeThickness="{StaticResource FocusVisualStrokeThickness}" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="toolkit:Accordion">
        <Setter Property="Background" Value="{StaticResource DarkBackground}" />
        <Setter Property="BorderBrush" Value="{StaticResource DarkBorder}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Cursor" Value="Arrow" />
        <Setter Property="Foreground" Value="{StaticResource HeaderForegroundBrush}" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="TabNavigation" Value="Once" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel Margin="0,1,0,0" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:Accordion">
                    <Grid x:Name="Root" Effect="{StaticResource LightControlShadowEffect}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border" Background="{TemplateBinding Background}" CornerRadius="2.5" />
                        <ScrollViewer BorderBrush="Transparent" BorderThickness="0" Background="{x:Null}" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" Margin="0" Padding="0" VerticalScrollBarVisibility="Disabled">
                            <ItemsPresenter />
                        </ScrollViewer>
                        <Border x:Name="OuterBorder" IsHitTestVisible="False" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2.5" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CustomScrollViewerStyle" TargetType="ScrollViewer">
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="BorderBrush" Value="{x:Null}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Margin" Value="2,1,1,2" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollViewer">
                    <Grid>
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="0,-1" Opacity="0.2" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}">
                            <Border.OpacityMask>
                                <LinearGradientBrush EndPoint="1.07,0.5" StartPoint="-0.07,0.5">
                                    <GradientStop Color="#FF000000" />
                                    <GradientStop Color="#7FFFFFFF" Offset="0.5" />
                                    <GradientStop Color="#FF000000" Offset="1" />
                                </LinearGradientBrush>
                            </Border.OpacityMask>
                        </Border>
                        <Grid Background="{TemplateBinding Background}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <ScrollContentPresenter x:Name="ScrollContentPresenter" Cursor="{TemplateBinding Cursor}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}" />
                            <Rectangle Grid.Column="1" Fill="#FFE9EEF4" Grid.Row="1" />
                            <ScrollBar x:Name="VerticalScrollBar" Grid.Column="1" IsTabStop="False" Maximum="{TemplateBinding ScrollableHeight}" Margin="0,-1" Minimum="0" Orientation="Vertical" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{TemplateBinding VerticalOffset}" ViewportSize="{TemplateBinding ViewportHeight}" Width="18" />
                            <ScrollBar x:Name="HorizontalScrollBar" Grid.Column="0" Height="18" IsTabStop="False" Maximum="{TemplateBinding ScrollableWidth}" Margin="-1,0,-1,-1" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{TemplateBinding HorizontalOffset}" ViewportSize="{TemplateBinding ViewportWidth}" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
    ***************************************************************************
    DataForm
    ***************************************************************************
    -->

    <Style TargetType="toolkit:DataForm">
        <Setter Property="AutoCommit" Value="True" />
        <Setter Property="AutoGenerateFields" Value="True" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="{StaticResource DarkBorder}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="DescriptionViewerPosition" Value="Auto" />
        <Setter Property="Foreground" Value="{StaticResource HeaderForegroundBrush}" />
        <Setter Property="HeaderVisibility" Value="Visible" />
        <Setter Property="LabelPosition" Value="Auto" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:DataForm">
                    <Grid toolkit:DataField.IsFieldGroup="True">
                        <Grid.Resources>
                            <Style TargetType="sdk:Label">
                                <Setter Property="Foreground" Value="{StaticResource NormalFontBrush}" />
                                <Setter Property="VerticalAlignment" Value="Center" />
                            </Style>
                            <Style x:Key="CustomScrollViewerStyle" TargetType="ScrollViewer">
                                <Setter Property="HorizontalContentAlignment" Value="Left" />
                                <Setter Property="BorderBrush" Value="{x:Null}" />
                                <Setter Property="BorderThickness" Value="0" />
                                <Setter Property="Margin" Value="2,1,1,2" />
                                <Setter Property="VerticalContentAlignment" Value="Top" />
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="ScrollViewer">
                                            <Grid>
                                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="0,-1" Opacity="0.2" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}">
                                                    <Border.OpacityMask>
                                                        <LinearGradientBrush EndPoint="1.07,0.5" StartPoint="-0.07,0.5">
                                                            <GradientStop Color="#FF000000" />
                                                            <GradientStop Color="#7FFFFFFF" Offset="0.5" />
                                                            <GradientStop Color="#FF000000" Offset="1" />
                                                        </LinearGradientBrush>
                                                    </Border.OpacityMask>
                                                </Border>
                                                <Grid Background="{TemplateBinding Background}">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="*" />
                                                        <ColumnDefinition Width="Auto" />
                                                    </Grid.ColumnDefinitions>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="*" />
                                                        <RowDefinition Height="Auto" />
                                                    </Grid.RowDefinitions>
                                                    <ScrollContentPresenter x:Name="ScrollContentPresenter" Cursor="{TemplateBinding Cursor}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}" />
                                                    <Rectangle Grid.Column="1" Fill="#FFE9EEF4" Grid.Row="1" />
                                                    <ScrollBar x:Name="VerticalScrollBar" Grid.Column="1" IsTabStop="False" Maximum="{TemplateBinding ScrollableHeight}" Margin="0,-1" Minimum="0" Orientation="Vertical" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{TemplateBinding VerticalOffset}" ViewportSize="{TemplateBinding ViewportHeight}" Width="18" />
                                                    <ScrollBar x:Name="HorizontalScrollBar" Grid.Column="0" Height="18" IsTabStop="False" Maximum="{TemplateBinding ScrollableWidth}" Margin="-1,0,-1,-1" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{TemplateBinding HorizontalOffset}" ViewportSize="{TemplateBinding ViewportWidth}" />
                                                </Grid>
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </Grid.Resources>
                        <Grid.Effect>
                            <StaticResource ResourceKey="LightControlShadowEffect" />
                        </Grid.Effect>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisual" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ModeStates">
                                <VisualState x:Name="ReadOnly" />
                                <VisualState x:Name="Empty">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="False" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentPresenter" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Edit">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="IsEnabled" Storyboard.TargetName="EditButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="false" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="CommitButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="CancelButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="AddNew" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="Invalid" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommittedStates">
                                <VisualState x:Name="Committed" />
                                <VisualState x:Name="Uncommitted">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.9" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ChangeIndicator" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ScopeStates">
                                <VisualState x:Name="Entity" />
                                <VisualState x:Name="Collection" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="DataFormBorder">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="28" />
                                    <RowDefinition />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Border Background="{StaticResource StaticControlBackground}" CornerRadius="2.5,2.5,0,0" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,0,1,0" />
                                <Border Background="{StaticResource DarkBackground}" CornerRadius="0,0,2.5,2.5" Grid.Row="1" Grid.RowSpan="3" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,0,1,1" />
                                <Grid MinHeight="27" Visibility="{TemplateBinding HeaderVisibility}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="8" />
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Orientation="Horizontal">
                                        <ContentControl x:Name="HeaderElement" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Foreground="{TemplateBinding Foreground}" FontWeight="Bold" Margin="12,0,0,0" VerticalAlignment="Center" />
                                        <TextBlock x:Name="ChangeIndicator" Foreground="{TemplateBinding Foreground}" FontWeight="Bold" Margin="3,-2,8,2" Opacity="0" Text="*" VerticalAlignment="Center" />
                                    </StackPanel>
                                    <StackPanel Grid.Column="2" HorizontalAlignment="Right" Margin="8,0" Orientation="Horizontal">
                                        <Button x:Name="FirstItemButton" HorizontalContentAlignment="Center" Style="{StaticResource OpacityButton}" Width="24">
                                            <StackPanel Orientation="Horizontal">
                                                <Rectangle Width="2" Height="8" Margin="0,0,2,0" Fill="#202020" />
                                                <Path Data="M0,0.5 L1,1 1,0Z" Width="5" Height="8" Fill="#202020" Stretch="Fill" />
                                            </StackPanel>
                                        </Button>
                                        <Button x:Name="PreviousItemButton" HorizontalContentAlignment="Center" Style="{StaticResource OpacityButton}" Width="24">
                                            <StackPanel Orientation="Horizontal">
                                                <Path Data="M0,0.5 L1,1 1,0Z" Width="5" Height="8" Fill="#202020" Stretch="Fill" />
                                            </StackPanel>
                                        </Button>
                                        <Button x:Name="NextItemButton" HorizontalContentAlignment="Center" Style="{StaticResource OpacityButton}" Width="24">
                                            <Path Data="M0,0 L1,1 L0,2 Z" Fill="{TemplateBinding Foreground}" Height="9" Margin="8,5,6,5" Opacity="0.85" Stretch="Fill" Width="5">
                                                <Path.Effect>
                                                    <DropShadowEffect BlurRadius="8" Color="#FFFFFFFF" Direction="100" ShadowDepth="0" />
                                                </Path.Effect>
                                                <Path.OpacityMask>
                                                    <LinearGradientBrush EndPoint="0.6,1" StartPoint="0.4,0">
                                                        <GradientStop Color="#7F000000" Offset="0" />
                                                        <GradientStop Color="#BF000000" Offset="0.25" />
                                                        <GradientStop Color="#FF000000" Offset="1" />
                                                    </LinearGradientBrush>
                                                </Path.OpacityMask>
                                            </Path>
                                        </Button>
                                        <Button x:Name="LastItemButton" HorizontalContentAlignment="Center" Style="{StaticResource OpacityButton}" Width="24">
                                            <StackPanel Orientation="Horizontal">
                                                <Path Data="M0,0 L1,0.5 0,1Z" Width="5" Height="8" Fill="#202020" Stretch="Fill" />
                                                <Rectangle Width="2" Height="8" Margin="2,0,0,0" Fill="#202020" />
                                            </StackPanel>
                                        </Button>
                                        <StackPanel x:Name="ButtonSeparator" Orientation="Horizontal" Height="24" Margin="6,0">
                                            <Rectangle Width="1">
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
                                                        <GradientStop Color="#0000" Offset="0" />
                                                        <GradientStop Color="#3000" Offset="0.3" />
                                                        <GradientStop Color="#3000" Offset="0.7" />
                                                        <GradientStop Color="#0000" Offset="1" />
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
                                            <Rectangle Width="1">
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
                                                        <GradientStop Color="#0FFF" Offset="0" />
                                                        <GradientStop Color="#FFFF" Offset="0.3" />
                                                        <GradientStop Color="#AFFF" Offset="0.7" />
                                                        <GradientStop Color="#0FFF" Offset="1" />
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
                                        </StackPanel>
                                        <Button x:Name="EditButton" HorizontalContentAlignment="Center" Style="{StaticResource OpacityButton}" ToolTipService.ToolTip="Edit" Width="24">
                                            <StackPanel Orientation="Horizontal">
                                                <Path Width="13" Height="13" Data="M3.34,7.70 L1.94,9.10 L1.36,11.58 L3.85,11.01 L5.25,9.61 z M7.01,2.84 L10.15,5.98 L4.13,12.00 L0,12.95 L0.99,8.86 z M9.95,0 C10.07,0 10.18,0.04 10.27,0.13 L12.82,2.67 C12.99,2.85 12.99,3.13 12.82,3.31 L12.40,3.72 L10.75,5.38 L7.57,2.20 L9.22,0.54 L9.64,0.13 C9.72,0.04 9.84,0 9.95,0 z" Fill="#101010" Stretch="Fill" UseLayoutRounding="True" />
                                            </StackPanel>
                                        </Button>
                                        <Button x:Name="NewItemButton" HorizontalContentAlignment="Center" Style="{StaticResource OpacityButton}" ToolTipService.ToolTip="Add" Width="24">
                                            <StackPanel Orientation="Horizontal">
                                                <Path Data="M0.5,0 L0.5,1 M0,0.5 L1,0.5" Width="12" Height="12" StrokeThickness="2" Stroke="#202020" Stretch="Fill" />
                                            </StackPanel>
                                        </Button>
                                        <Button x:Name="DeleteItemButton" HorizontalContentAlignment="Center" Style="{StaticResource OpacityButton}" ToolTipService.ToolTip="Delete" Width="24">
                                            <StackPanel Orientation="Horizontal">
                                                <Path Data="M0,0 L1,1 M0,1 L1,0" Width="10" Height="10" StrokeThickness="2" Stroke="#202020" Stretch="Fill" />
                                            </StackPanel>
                                        </Button>
                                    </StackPanel>
                                </Grid>
                                <ScrollViewer Background="{x:Null}" IsTabStop="False" Padding="{TemplateBinding Padding}" Grid.Row="1" Style="{StaticResource CustomScrollViewerStyle}" VerticalScrollBarVisibility="Auto">
                                    <ContentPresenter x:Name="ContentPresenter" Margin="12,12,6,12" />
                                </ScrollViewer>
                                <sdk:ValidationSummary x:Name="ValidationSummary" BorderThickness="0" MaxHeight="100" Grid.Row="2" />
                                <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="3">
                                    <Button x:Name="CommitButton" Content="OK" HorizontalContentAlignment="Center" Margin="12" MinWidth="71" MinHeight="17" Visibility="Collapsed" VerticalContentAlignment="Center" />
                                    <Button x:Name="CancelButton" Content="Cancel" HorizontalContentAlignment="Center" Margin="12" MinWidth="71" MinHeight="17" Visibility="Collapsed" VerticalContentAlignment="Center" />
                                </StackPanel>
                            </Grid>
                        </Border>
                        <Border x:Name="DisabledVisual" Background="{StaticResource DisabledBrush}" CornerRadius="2.5" IsHitTestVisible="False" Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
    ***************************************************************************
    Chart
    ***************************************************************************
    -->

    <Style TargetType="toolkit:Chart">
        <Setter Property="BorderBrush" Value="{x:Null}" />
        <Setter Property="Background" Value="White" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Padding" Value="10" />
        <Setter Property="Palette">
            <Setter.Value>
                <toolkit:ResourceDictionaryCollection>
                    <!-- Green -->
                    <ResourceDictionary>
                        <RadialGradientBrush x:Key="Background" Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
                            <GradientStop Color="#B2C60D" />
                            <GradientStop Color="#4C7B00" Offset="1" />
                        </RadialGradientBrush>
                        <Style x:Key="DataPointStyle" TargetType="Control">
                            <Setter Property="Background" Value="{StaticResource Background}" />
                        </Style>
                        <Style x:Key="DataShapeStyle" TargetType="Shape">
                            <Setter Property="Stroke" Value="{StaticResource Background}" />
                            <Setter Property="StrokeThickness" Value="2" />
                            <Setter Property="StrokeMiterLimit" Value="1" />
                            <Setter Property="Fill" Value="{StaticResource Background}" />
                        </Style>
                    </ResourceDictionary>

                    <!-- Blue -->
                    <ResourceDictionary>
                        <RadialGradientBrush x:Key="Background" Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
                            <GradientStop Color="#39B7FF" />
                            <GradientStop Color="#0065AD" Offset="1" />
                        </RadialGradientBrush>
                        <Style x:Key="DataPointStyle" TargetType="Control">
                            <Setter Property="Background" Value="{StaticResource Background}" />
                        </Style>
                        <Style x:Key="DataShapeStyle" TargetType="Shape">
                            <Setter Property="Stroke" Value="{StaticResource Background}" />
                            <Setter Property="StrokeThickness" Value="2" />
                            <Setter Property="StrokeMiterLimit" Value="1" />
                            <Setter Property="Fill" Value="{StaticResource Background}" />
                        </Style>
                    </ResourceDictionary>

                    <!-- Gray -->
                    <ResourceDictionary>
                        <RadialGradientBrush x:Key="Background" Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
                            <GradientStop Color="#85878C" />
                            <GradientStop Color="#33353A" Offset="1" />
                        </RadialGradientBrush>
                        <Style x:Key="DataPointStyle" TargetType="Control">
                            <Setter Property="Background" Value="{StaticResource Background}" />
                        </Style>
                        <Style x:Key="DataShapeStyle" TargetType="Shape">
                            <Setter Property="Stroke" Value="{StaticResource Background}" />
                            <Setter Property="StrokeThickness" Value="2" />
                            <Setter Property="StrokeMiterLimit" Value="1" />
                            <Setter Property="Fill" Value="{StaticResource Background}" />
                        </Style>
                    </ResourceDictionary>

                    <!-- Orange -->
                    <ResourceDictionary>
                        <RadialGradientBrush x:Key="Background" Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
                            <GradientStop Color="#FF9600" />
                            <GradientStop Color="#942B00" Offset="1" />
                        </RadialGradientBrush>
                        <Style x:Key="DataPointStyle" TargetType="Control">
                            <Setter Property="Background" Value="{StaticResource Background}" />
                        </Style>
                        <Style x:Key="DataShapeStyle" TargetType="Shape">
                            <Setter Property="Stroke" Value="{StaticResource Background}" />
                            <Setter Property="StrokeThickness" Value="2" />
                            <Setter Property="StrokeMiterLimit" Value="1" />
                            <Setter Property="Fill" Value="{StaticResource Background}" />
                        </Style>
                    </ResourceDictionary>

                    <!-- Red -->
                    <ResourceDictionary>
                        <RadialGradientBrush x:Key="Background" Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
                            <GradientStop Color="#EE6028" />
                            <GradientStop Color="#8B0000" Offset="1" />
                        </RadialGradientBrush>
                        <Style x:Key="DataPointStyle" TargetType="Control">
                            <Setter Property="Background" Value="{StaticResource Background}" />
                        </Style>
                        <Style x:Key="DataShapeStyle" TargetType="Shape">
                            <Setter Property="Stroke" Value="{StaticResource Background}" />
                            <Setter Property="StrokeThickness" Value="2" />
                            <Setter Property="StrokeMiterLimit" Value="1" />
                            <Setter Property="Fill" Value="{StaticResource Background}" />
                        </Style>
                    </ResourceDictionary>

                    <!-- Yellow -->
                    <ResourceDictionary>
                        <RadialGradientBrush x:Key="Background" Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
                            <GradientStop Color="#FFC12B" />
                            <GradientStop Color="#FF7600" Offset="1" />
                        </RadialGradientBrush>
                        <Style x:Key="DataPointStyle" TargetType="Control">
                            <Setter Property="Background" Value="{StaticResource Background}" />
                        </Style>
                        <Style x:Key="DataShapeStyle" TargetType="Shape">
                            <Setter Property="Stroke" Value="{StaticResource Background}" />
                            <Setter Property="StrokeThickness" Value="2" />
                            <Setter Property="StrokeMiterLimit" Value="1" />
                            <Setter Property="Fill" Value="{StaticResource Background}" />
                        </Style>
                    </ResourceDictionary>

                    <!-- Pink -->
                    <ResourceDictionary>
                        <RadialGradientBrush x:Key="Background" Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
                            <GradientStop Color="#E94780" />
                            <GradientStop Color="#A4023B" Offset="1" />
                        </RadialGradientBrush>
                        <Style x:Key="DataPointStyle" TargetType="Control">
                            <Setter Property="Background" Value="{StaticResource Background}" />
                        </Style>
                        <Style x:Key="DataShapeStyle" TargetType="Shape">
                            <Setter Property="Stroke" Value="{StaticResource Background}" />
                            <Setter Property="StrokeThickness" Value="2" />
                            <Setter Property="StrokeMiterLimit" Value="1" />
                            <Setter Property="Fill" Value="{StaticResource Background}" />
                        </Style>
                    </ResourceDictionary>

                    <!-- Royal Blue -->
                    <ResourceDictionary>
                        <RadialGradientBrush x:Key="Background" Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
                            <GradientStop Color="#4C7AC0" />
                            <GradientStop Color="#07357B" Offset="1" />
                        </RadialGradientBrush>
                        <Style x:Key="DataPointStyle" TargetType="Control">
                            <Setter Property="Background" Value="{StaticResource Background}" />
                        </Style>
                        <Style x:Key="DataShapeStyle" TargetType="Shape">
                            <Setter Property="Stroke" Value="{StaticResource Background}" />
                            <Setter Property="StrokeThickness" Value="2" />
                            <Setter Property="StrokeMiterLimit" Value="1" />
                            <Setter Property="Fill" Value="{StaticResource Background}" />
                        </Style>
                    </ResourceDictionary>

                    <!-- Cyan -->
                    <ResourceDictionary>
                        <RadialGradientBrush x:Key="Background" Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
                            <GradientStop Color="#40ABCA" />
                            <GradientStop Color="#1E505F" Offset="1" />
                        </RadialGradientBrush>
                        <Style x:Key="DataPointStyle" TargetType="Control">
                            <Setter Property="Background" Value="{StaticResource Background}" />
                        </Style>
                        <Style x:Key="DataShapeStyle" TargetType="Shape">
                            <Setter Property="Stroke" Value="{StaticResource Background}" />
                            <Setter Property="StrokeThickness" Value="2" />
                            <Setter Property="StrokeMiterLimit" Value="1" />
                            <Setter Property="Fill" Value="{StaticResource Background}" />
                        </Style>
                    </ResourceDictionary>

                    <!-- Purple -->
                    <ResourceDictionary>
                        <RadialGradientBrush x:Key="Background" Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
                            <GradientStop Color="#9A5AA6" />
                            <GradientStop Color="#482A4E" Offset="1" />
                        </RadialGradientBrush>
                        <Style x:Key="DataPointStyle" TargetType="Control">
                            <Setter Property="Background" Value="{StaticResource Background}" />
                        </Style>
                        <Style x:Key="DataShapeStyle" TargetType="Shape">
                            <Setter Property="Stroke" Value="{StaticResource Background}" />
                            <Setter Property="StrokeThickness" Value="2" />
                            <Setter Property="StrokeMiterLimit" Value="1" />
                            <Setter Property="Fill" Value="{StaticResource Background}" />
                        </Style>
                    </ResourceDictionary>

                    <!-- Brown -->
                    <ResourceDictionary>
                        <RadialGradientBrush x:Key="Background" Center="0.075,0.015" GradientOrigin="-0.1,-0.1" RadiusY="0.9" RadiusX="1.05">
                            <GradientStop Color="#775931" />
                            <GradientStop Color="#210000" Offset="1" />
                        </RadialGradientBrush>
                        <Style x:Key="DataPointStyle" TargetType="Control">
                            <Setter Property="Background" Value="{StaticResource Background}" />
                        </Style>
                        <Style x:Key="DataShapeStyle" TargetType="Shape">
                            <Setter Property="Stroke" Value="{StaticResource Background}" />
                            <Setter Property="StrokeThickness" Value="2" />
                            <Setter Property="StrokeMiterLimit" Value="1" />
                            <Setter Property="Fill" Value="{StaticResource Background}" />
                        </Style>
                    </ResourceDictionary>
                </toolkit:ResourceDictionaryCollection>
            </Setter.Value>
        </Setter>
        <Setter Property="TitleStyle">
            <Setter.Value>
                <Style TargetType="toolkit:Title">
                    <Setter Property="FontSize" Value="24" />
                    <Setter Property="HorizontalAlignment" Value="Left" />
                    <Setter Property="Margin" Value="0,0,0,25" />
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="LegendStyle">
            <Setter.Value>
                <Style TargetType="toolkit:Legend">
                    <Setter Property="Margin" Value="10,0,0,0" />
                    <Setter Property="VerticalAlignment" Value="Top" />
                    <Setter Property="BorderBrush" Value="#808080" />
                    <Setter Property="Background" Value="#F0F0F0" />
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="ChartAreaStyle">
            <Setter.Value>
                <Style TargetType="Panel">
                    <Setter Property="MinWidth" Value="100" />
                    <Setter Property="MinHeight" Value="75" />
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="PlotAreaStyle">
            <Setter.Value>
                <Style TargetType="Grid">
                    <Setter Property="Background" Value="Transparent" />
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkit:Chart">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" CornerRadius="4" Effect="{StaticResource LightControlShadowEffect}">
                        <Grid Margin="{TemplateBinding Padding}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <toolkit:Title Content="{TemplateBinding Title}" Style="{TemplateBinding TitleStyle}" />
                            <Grid Grid.Row="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <dvp:EdgePanel x:Name="ChartArea" Style="{TemplateBinding ChartAreaStyle}">
                                    <Border BorderBrush="#D0D0D0" BorderThickness="1" Canvas.ZIndex="10" />
                                    <Grid Style="{TemplateBinding PlotAreaStyle}" Canvas.ZIndex="-1" />
                                </dvp:EdgePanel>
                                <toolkit:Legend x:Name="Legend" Grid.Column="1" Header="{TemplateBinding LegendTitle}" Style="{TemplateBinding LegendStyle}">
                                    <toolkit:Legend.Effect>
                                        <DropShadowEffect Opacity="0.25" BlurRadius="4" ShadowDepth="2" Direction="-90" />
                                    </toolkit:Legend.Effect>
                                </toolkit:Legend>
                            </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
    ***************************************************************************
    MenuItem
    ***************************************************************************
    -->

    <Style TargetType="toolkit:MenuItem">
    	<Setter Property="Background" Value="Transparent"/>
    	<Setter Property="BorderBrush" Value="Transparent"/>
    	<Setter Property="Foreground" Value="{StaticResource InputForegroundBrush}"/>
    	<Setter Property="Padding" Value="8,0"/>
    	<Setter Property="VerticalAlignment" Value="Center"/>
    	<Setter Property="Template">
    		<Setter.Value>
    			<ControlTemplate TargetType="toolkit:MenuItem">
    				<Grid>
    					<VisualStateManager.VisualStateGroups>
    						<VisualStateGroup x:Name="CommonStates">
    							<VisualState x:Name="Normal"/>
    							<VisualState x:Name="Disabled">
    								<Storyboard>
    									<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Presenter"/>
    									<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentControl" d:IsOptimized="True"/>
    								</Storyboard>
    							</VisualState>
    						</VisualStateGroup>
    						<VisualStateGroup x:Name="FocusStates">
    							<VisualState x:Name="Unfocused"/>
    							<VisualState x:Name="Focused">
    								<Storyboard>
    									<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="FocusedElement" d:IsOptimized="True"/>
    									<ColorAnimation Duration="0" To="White" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="Presenter" d:IsOptimized="True"/>
    								</Storyboard>
    							</VisualState>
    						</VisualStateGroup>
    					</VisualStateManager.VisualStateGroups>
    					<Grid MinHeight="28" VerticalAlignment="Center">
    						<Grid.ColumnDefinitions>
    							<ColumnDefinition MinWidth="30" Width="Auto"/>
    							<ColumnDefinition Width="*"/>
    						</Grid.ColumnDefinitions>
    						<Border x:Name="FocusedElement" Background="{StaticResource InputSelectionBrush}" Grid.ColumnSpan="2" Opacity="0"/>
    						<ContentPresenter x:Name="contentControl" Content="{TemplateBinding Icon}" Margin="1" VerticalAlignment="Center"/>
    						<ContentControl x:Name="Presenter" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Foreground="{TemplateBinding Foreground}" Grid.Column="1" Margin="{TemplateBinding Padding}" VerticalAlignment="Center" />
    					</Grid>
    				</Grid>
    			</ControlTemplate>
    		</Setter.Value>
    	</Setter>
    </Style>

    <!-- 
    ***************************************************************************
    ContextMenu
    ***************************************************************************
    -->

    <Style TargetType="toolkit:ContextMenu">
    	<Setter Property="Background" Value="#FFE0E0E0"/>
    	<Setter Property="BorderThickness" Value="1"/>
    	<Setter Property="BorderBrush" Value="{StaticResource DarkBorder}"/>
    	<Setter Property="Padding" Value="0,6"/>
    	<Setter Property="Template">
    		<Setter.Value>
    			<ControlTemplate TargetType="toolkit:ContextMenu">
    				<Grid>
    					<Grid.Effect>
    						<DropShadowEffect BlurRadius="20" Opacity="0.4" ShadowDepth="20" />
    					</Grid.Effect>
    					<Grid.ColumnDefinitions>
    						<ColumnDefinition MaxWidth="30" />
    						<ColumnDefinition Width="*" />
    					</Grid.ColumnDefinitions>
    					<Border Background="#FFD0D0D2" BorderBrush="#FFB6B6BA" BorderThickness="0,0,1,0" CornerRadius="2.5,0,0,2.5" Margin="1,1,0,1" />
    					<Border Background="{TemplateBinding Background}" BorderBrush="#FFF0F0F0" BorderThickness="1,0,0,0" CornerRadius="0,2.5,2.5,0" Grid.Column="1" Margin="0,1,1,1"/>
    					<ItemsPresenter Grid.ColumnSpan="2" Margin="{TemplateBinding Padding}"/>
    					<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2.5" Grid.ColumnSpan="2" IsHitTestVisible="False" />
    				</Grid>
    			</ControlTemplate>
    		</Setter.Value>
    	</Setter>
    </Style>

</ResourceDictionary>